function getComponent() {
  return import('lodash')
    .then(({ default: _ }) => {
      const element = document.createElement('div')

      element.innerHTML = _.join(['Hello', 'webpack'], ' ')

      return element
    })
    .catch((error) => 'An error occurred while loading the component');
}

function getAddComponent() {
  return import(/* webpackPrefetch: true */ './components/MyTest')
    .then(({ default: add }) => {
      return add(5, 6)
    })
    .catch((error) => 'An error occurred while loading the component');
}

document.body.addEventListener('click', () => {
  getComponent().then((component) => {
    document.body.appendChild(component)
  })

  getAddComponent().then((result) => {
    document.body.innerHTML += '<h1>' + result + '</h1>'
  })
}, false)